Skip to main content




submitted by /u/niceperl
[link] [comments]









I want to repeat a process for every key in a hash, with numeric keys. So there are 3 possibilities, with 3 if, and each one compares the value of the index of an array, so that if that position eq to "sp", "sp2" or "sp3" it will search in a document some value so then it can be printed. It doesn´t work and every times gives me only one value, i would like to get the values that correspond with the hash. For example the hash could be %grupos=(1,'A',2,'G',3,'J')

and the array @hibridaciones=("sp","sp2",sp3")

The document .txt (simplified) is:

HS0.32 CS0,77 CD0.62 CT0,59 C10,77 C20,62 C30,59 OS0.73 OD0,6 O10,73 O20,6 NS0.75

The code is:

open (covalencia,"<", "cov.txt") or die "$!\n"; print keys %grupos; keys %grupos; foreach my $z (keys %grupos) { print "\n$z\n"; if (@hibridaciones[my $z-1] eq “sp") { while (my $line = <covalencia>) { if ( $line=~/C1/) { $line =~s/C1//; $radio=$line; print "\n$radio"; } } } if (@hibridaciones[my $z-1] eq "sp2") { while (my $line = <covalencia>) { if ($line=~/C2/) { $line =~s/C2//; $radio=$line; print "\n$radio"; } } } if (@hibridaciones[my $z-1] eq "sp3") { while (my $line = <covalencia>) { if ($line=~/C3/) { $line =~s/C3//; $radio=$line; print "\n$radio"; } } } } close (covalencia);

submitted by /u/SamuchRacoon
[link] [comments]



submitted by /u/niceperl
[link] [comments]



German Perl/Raku Workshop 2024 recordings on YouTube submitted by /u/Adriaaaaaaaan
[link] [comments]


On this site: https://codegolf.stackexchange.com/questions/246845/convert-json-object-of-directories-to-list-of-paths

There is an interesting perl solution but I'm trying to wrap my head around it and am baffled.

map/}/?/{/&&say($s)..$s=~s|[^/]+/$||:($s.=s/"//gr."/"),/{?}|".+?"/g When I do a simple test: my $s = <some json string> .. the map above I don't get any output. Thanks in advance 

submitted by /u/UnicodeConfusion
[link] [comments]


I have a bunch of files that I am parsing out a simple tag
<institution content-type="division">(.+?)?<\/institution>

Everything is going fine until I hit this result:
2) School of Chemical &amp; Biomolecular Engineering

This is complaining because it thinks the ) is unmatched. How do I get it to accept whatever is in the capture? I tried playing around with \Q and \E but that isn't working. For clarity, I won't know what is in this tag, it could be anything at all and the tag is simple enough that I don't want to use some XML parser.

submitted by /u/sirhalos
[link] [comments]







I'm experimenting with different frameworks and I've come across this wonderful catalyst framework based on Perl, does anyone know of a front end (which is website, forums, etc.) coupled with a back end (tracker engine) for use with modern Perl? I have a PHP based one and was wondering if it was possible to do the same using Perl.

submitted by /u/Otherwise-Tune-257
[link] [comments]






Asking for a friend. No really, I don't use VSCode but I know that a lot of people do and in one week I had two different people ask me this. I didn't see anything in the Visual Studio Marketplace. I'm looking for something like markdown-preview enhanced, but for Pod.

If you don't have that, is it something that you would want?

If it's something you want, would you throw in some money to have it? This isn't something I'd do myself, but I know some people with some free time who could use a little money. I could crowdfund it or whatever. The intent is to have something free in the Marketplace.

Would you care if it's not implemented in Perl? If it was JS or whatever VSCode prefers but does the job, that's fine with me (and remember I don't use VSCode). I have no idea how much that matters, but I'd hate for people to have to do all sorts of crazy setup, which for many people is installing anything from CPAN.

submitted by /u/briandfoy
[link] [comments]